<template>
    <a-button :type :shape :size :loading :block :ghost :danger :icon v-Permission="{ currentRouteMeta, permission }">
        <slot />
        <slot name="icon"></slot>
    </a-button>
</template>
<script lang="ts" setup>
import { inject } from 'vue';

// v-Permission="{ currentRouteMeta, permission }"

// interface BtnType {
//     title?: string
//     type?: string
//     shape?: string
//     danger?: boolean
//     size?: string
//     block?: boolean
//     ghost?: boolean
//     loading?: boolean
//     icon?: Function | Component
//     permission?: string
//     clickFn?: () => void
// }

defineProps({
    type: String,
    shape: String,
    size: String,
    loading: Boolean,
    block: Boolean,
    ghost: Boolean,
    danger: Boolean,
    icon: Object,
    permission: String,
    currentRouteMeta: Array
})

const BtnsObj: {
    currentRouteMeta: string[],
    // Btns: BtnType[]
} = inject('permissionBtns')!
const { currentRouteMeta } = BtnsObj

</script>
<style scoped></style>